package com.hoas.quickstart.threads.chapter02.chapter02_2_8_01;

public class Run1_2 {

    public static void main(String[] args) {

        System.out.println("结论1：多个线程同时执行 synchronized(x){}同步代码块时呈现同步效果");

        Service service = new Service();
        MyObject object1 = new MyObject();
        MyObject object2 = new MyObject();

        ThreadA  a  = new ThreadA(service, object1);
        a.setName("a");
        a.start();

        ThreadB  b  = new ThreadB(service, object2);
        b.setName("b");
        b.start();


    }

}
